package com.pxd.ServeDemo2.Impl;

import com.pxd.ServeDemo2.TranslateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Service
public class English2ChineseImpl implements TranslateService {

    @Override
    public String translate(String word) {
        if ("hello".equals(word)){
            return "hello->你好";
        }
        return "未知吧 ";
    }
}
@Service
class Franch2ChineseImpl implements TranslateService {

    @Override
    public String translate(String word) {
        if ("bonjour".equals(word)){
            return "bonjour->你好";
        }
        return "未知吧 ";
    }
}





